//
//  DZPassView.m
//  DaoZiJinFu
//
//  Created by dzjf on 2017/5/5.
//  Copyright © 2017年 dzjf. All rights reserved.
//

#import "DZPassView.h"

@implementation DZPassView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
*/
 - (void)drawRect:(CGRect)rect {
     UIBezierPath *path;
     if (_selectArr.count == 0) {
         return;
     }
     path = [UIBezierPath bezierPath];
     path.lineWidth = 2;
     path.lineJoinStyle = kCGLineCapRound;
     path.lineCapStyle = kCGLineCapRound;
     if (self.style) {
         [BLUE_COLOR set];
     }else
     {
        [RGB(239, 216, 213) set];
     }
     for (int i = 0; i < _selectArr.count; i ++) {
         UIButton *btn = _selectArr[i];
         if (i == 0) {
             [path moveToPoint:btn.center];
         }else
         {
             [path addLineToPoint:btn.center];
         }
     }
     [path addLineToPoint:_currtPoint];
     [path stroke];
}


@end
